﻿using System;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using HigLabo.Net.Extensions;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class Size : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public Int32 Height { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Resize { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Width { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Url { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public Size(String jsonText)
        {
            var d = this.SetData(jsonText);

            this.Height = d.ToInt32("h") ?? 0;
            this.Resize = d.ToString("resize");
            this.Width = d.ToInt32("w") ?? 0;
            this.Url = d.ToString("url");
        }
    }
}
